package week2

import (
	"errors"
	"fmt"
)
type errorString string

func (e errorString) Error() string {
	return string(e)
}
func New(text string ) error {
	return errorString(text)
}

var ErrNamedType = New("EOF")
var ErrStructType = errors.New("EOF")

// errors.New 用指针判定 error
func T1() {
	if ErrNamedType == New("EOF"){
		fmt.Println("Named Type Error")
	}

	if ErrStructType == errors.New("EOF"){
		fmt.Println("Struct Type Error")
	}
}
